package cn.hznc.repository;

import cn.hznc.domain.entity.MachineToolStatus;
import cn.hznc.domain.request.device.DeviceRunningReq;
import cn.hznc.domain.request.process.HistoryStatusReq;
import cn.hznc.domain.request.program.SubprogramUsageReportReq;
import cn.hznc.vo.StatusVo;
import cn.hznc.vo.SubProgramUsageReportVo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @Author：Administrator
 * @Date：2023/9/24 17:38
 */
public interface MachineToolStatusRepository{
    List<StatusVo> selectByCondition(@Param("historyStatusReq") HistoryStatusReq historyStatusReq);

    List<StatusVo> selectByConditionReload(@Param("mapToSnCode") String mapToSnCode,@Param("startTime") Date startTime,@Param("endTime") Date endTime);
    List<StatusVo> selectByDeviceList(@Param("snCodes") List<String> snCodes,@Param("startTime") Date startTime,@Param("endTime") Date endTime);

    List<MachineToolStatus> selectList(@Param("deviceList") List<String> deviceList,@Param("startTime") Date startTime,@Param("endTime") Date endTime);

    MachineToolStatus selectRecentlyStatus(@Param("time") Date time , @Param("snCode") String snCode);

    void updateBzById(@Param("id") Integer id,@Param("bz") String bz);

    List<SubProgramUsageReportVo> subProgramUsageReport(SubprogramUsageReportReq subprogramUsageReportReq);

    SubProgramUsageReportVo subProgramUsageReportReload(@Param("program") String program);

    List<SubProgramUsageReportVo> subProgramUsageReportDetail(SubprogramUsageReportReq subprogramUsageReportReq);

    List<MachineToolStatus> selectListReload(@Param("device") String device,@Param("startTime") Date startTime,@Param("endTime") Date endTime);

    List<StatusVo> selectByDeviceListReload(List<String> snCodes, List<DeviceRunningReq> deviceRunningReqs);

    List<MachineToolStatus> selectListBySnCodes(@Param("snCodes")List<String> snCodes,@Param("startTime") Date startTime,@Param("endTime") Date endTime);

    List<MachineToolStatus> selectListBySnCode(@Param("snCode")String snCode,@Param("startTime") Date startTime,@Param("endTime") Date endTime);

    List<StatusVo> selectNearlySnStatusRecord(@Param("snCodes") List<String> snCodes,@Param("startTime") Date startTime);
}
